﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using UnityEngine;

namespace GJXQGame
{
    public class PlayinfoSpawner : Singleton<PlayinfoSpawner>
    {
        public void InitChessChessObj(Transform Obj)
        {
            for (int x = 0; x < 8; x++)
            {
                for (int y = 0; y < 8; y++)
                {
                    GameObject slotItemClone =GameObject.Instantiate(Resources.Load<GameObject>("Windows/Prefab/pt_ChessSlot"));
                    slotItemClone.transform.SetParent(Obj);
                    slotItemClone.transform.localScale = Vector3.one;
                    ChessPieseSlot slot = slotItemClone.GetComponent<ChessPieseSlot>();
                    slot.JewelPower = (PowerType)GameManager.ChessDataControl.mLastMapFirst[x, y].power;
                    slot.JewelPosition.Point_x = x;
                    slot.JewelPosition.Point_y = y;
                    slot.Type = GameManager.ChessDataControl.mLastMapFirst[x, y].type;
                    slot.RefShow();
                    PlayInfoData.GetInstance().mLastMapThird[x, y] = slotItemClone;
                }
            }
        }
    }
}
